
/* First created by JCasGen Mon Mar 28 12:51:53 CEST 2011 */
package ia1011.zanzibar.chaos.type;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;

/** A Phrase is a graph whose nodes are constituents and edges are the grammatical relations between the constituents.
 * Updated by JCasGen Mon Mar 28 12:52:46 CEST 2011
 * @generated */
public class UimaSentence_Type extends Annotation_Type {
  /** @generated */
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator = 
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (UimaSentence_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = UimaSentence_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new UimaSentence(addr, UimaSentence_Type.this);
  			   UimaSentence_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new UimaSentence(addr, UimaSentence_Type.this);
  	  }
    };
  /** @generated */
  public final static int typeIndexID = UimaSentence.typeIndexID;
  /** @generated 
     @modifiable */
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("ia1011.zanzibar.chaos.type.UimaSentence");
 
  /** @generated */
  final Feature casFeat_caseSensitive;
  /** @generated */
  final int     casFeatCode_caseSensitive;
  /** @generated */ 
  public boolean getCaseSensitive(int addr) {
        if (featOkTst && casFeat_caseSensitive == null)
      jcas.throwFeatMissing("caseSensitive", "ia1011.zanzibar.chaos.type.UimaSentence");
    return ll_cas.ll_getBooleanValue(addr, casFeatCode_caseSensitive);
  }
  /** @generated */    
  public void setCaseSensitive(int addr, boolean v) {
        if (featOkTst && casFeat_caseSensitive == null)
      jcas.throwFeatMissing("caseSensitive", "ia1011.zanzibar.chaos.type.UimaSentence");
    ll_cas.ll_setBooleanValue(addr, casFeatCode_caseSensitive, v);}
    
  
 
  /** @generated */
  final Feature casFeat_constituents;
  /** @generated */
  final int     casFeatCode_constituents;
  /** @generated */ 
  public int getConstituents(int addr) {
        if (featOkTst && casFeat_constituents == null)
      jcas.throwFeatMissing("constituents", "ia1011.zanzibar.chaos.type.UimaSentence");
    return ll_cas.ll_getRefValue(addr, casFeatCode_constituents);
  }
  /** @generated */    
  public void setConstituents(int addr, int v) {
        if (featOkTst && casFeat_constituents == null)
      jcas.throwFeatMissing("constituents", "ia1011.zanzibar.chaos.type.UimaSentence");
    ll_cas.ll_setRefValue(addr, casFeatCode_constituents, v);}
    
   /** @generated */
  public int getConstituents(int addr, int i) {
        if (featOkTst && casFeat_constituents == null)
      jcas.throwFeatMissing("constituents", "ia1011.zanzibar.chaos.type.UimaSentence");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_constituents), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_constituents), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_constituents), i);
  }
   
  /** @generated */ 
  public void setConstituents(int addr, int i, int v) {
        if (featOkTst && casFeat_constituents == null)
      jcas.throwFeatMissing("constituents", "ia1011.zanzibar.chaos.type.UimaSentence");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_constituents), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_constituents), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_constituents), i, v);
  }
 
 
  /** @generated */
  final Feature casFeat_dependencies;
  /** @generated */
  final int     casFeatCode_dependencies;
  /** @generated */ 
  public int getDependencies(int addr) {
        if (featOkTst && casFeat_dependencies == null)
      jcas.throwFeatMissing("dependencies", "ia1011.zanzibar.chaos.type.UimaSentence");
    return ll_cas.ll_getRefValue(addr, casFeatCode_dependencies);
  }
  /** @generated */    
  public void setDependencies(int addr, int v) {
        if (featOkTst && casFeat_dependencies == null)
      jcas.throwFeatMissing("dependencies", "ia1011.zanzibar.chaos.type.UimaSentence");
    ll_cas.ll_setRefValue(addr, casFeatCode_dependencies, v);}
    
   /** @generated */
  public int getDependencies(int addr, int i) {
        if (featOkTst && casFeat_dependencies == null)
      jcas.throwFeatMissing("dependencies", "ia1011.zanzibar.chaos.type.UimaSentence");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_dependencies), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_dependencies), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_dependencies), i);
  }
   
  /** @generated */ 
  public void setDependencies(int addr, int i, int v) {
        if (featOkTst && casFeat_dependencies == null)
      jcas.throwFeatMissing("dependencies", "ia1011.zanzibar.chaos.type.UimaSentence");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_dependencies), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_dependencies), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_dependencies), i, v);
  }
 



  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public UimaSentence_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

 
    casFeat_caseSensitive = jcas.getRequiredFeatureDE(casType, "caseSensitive", "uima.cas.Boolean", featOkTst);
    casFeatCode_caseSensitive  = (null == casFeat_caseSensitive) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_caseSensitive).getCode();

 
    casFeat_constituents = jcas.getRequiredFeatureDE(casType, "constituents", "uima.cas.FSArray", featOkTst);
    casFeatCode_constituents  = (null == casFeat_constituents) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_constituents).getCode();

 
    casFeat_dependencies = jcas.getRequiredFeatureDE(casType, "dependencies", "uima.cas.FSArray", featOkTst);
    casFeatCode_dependencies  = (null == casFeat_dependencies) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_dependencies).getCode();

  }
}



    